home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: cs.vu.nl!irmen
- From: irmen@cs.vu.nl (Irmen de Jong)
- Subject: Re: File sizes
- Nntp-Posting-Host: schokker.cs.vu.nl
- References: <4gd9pu$cpr@mn5.swip.net> <WXQ7y*5+f@yaps.rhein.de> <4gjs20$i68@btmpjg.god.bel.alcatel.be> <Dn81zD.H5M.0.-s@cs.vu.nl> <4grop1$puv@btmpjg.god.bel.alcatel.be>
- Sender: news@cs.vu.nl
- Organization: Dept. of Computer Science, Vrije Universiteit Amsterdam
- Date: Mon, 26 Feb 1996 12:51:02 GMT
- X-Newsreader: TIN [version 1.2 PL2]
- Message-ID: <DnDvp3.5Mt.0.-s@cs.vu.nl>
-
- On 26 Feb 1996 07:50:57 GMT barnhoorn@nlev00 (barnhoorn@nlev00) wrote:
-
- : In article <Dn81zD.H5M.0.-s@cs.vu.nl>, irmen@cs.vu.nl (Irmen de Jong) writes:
- : |> On 23 Feb 1996 07:57:52 GMT barnhoorn@nlev00 (barnhoorn@nlev00) wrote:
- : |> : |> > What's the best way of finding out the size of a file? Do I have to use
- : |> : |> > Examine()
- : |> : ..or do it in ANSI-C, by opening the file, seeking to the end of it
- : |> : and getting the number of bytes returned from fseek().
- : |> Aaaargh why does nobody use fstat()? Seeking to the end of a many-megabyte-file
- : |> can take ages, especially on floppy. fstat() (and dos.library/Examine()) are
- : |> instantaneous, AFAIK.
-
- : I admit that fseek() might take a long time to return. But I think
- : fseek() will return the real filesize, also on XPK-devices, because
- : it has to be unpacked.
- : Is fstat() a function that decrunches the file also?
-
- : ---------------------------------------------------------------------------
- : Jaco Barnhoorn barnie@xs4all.nl
-
- Dunno. I think not. I'm almost 100% sure that fstat() is implemented using
- Examine() or ExamineFH() (that is how I should do it).
-
- Anyway, how often are you interested in the file size after decrunching?
- Myself: 0 times so far. I only care about the actual file size on disk.
- Thus: I'm perfectly happy with Examine(), ExamineFH() (very conveninent)
- and fstat() for ANSI C.
-
- By the way: doesn't Examine() on an XPK-device also return the file size
- after decrunching? I think so. Thus: the fseek() to the end of the file
- is stupid, IMHO.
-
- --
- / Irmen de Jong (email: irmen@cs.vu.nl WWW: http://www.cs.vu.nl/~irmen/) \
- \ ``Nothing lasts forever'' -- Species /
-